// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Engine/GameInstance.h"
#include "Engine/EngineTypes.h"
#include "StructAndEnum/StructAndEnum.h"
#include "Blueprint/UserWidget.h"
#include "SGameGameInstance.generated.h"

/**
 * 
 */

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FChat, FChatMessage, ChatMessage);//聊天代理
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCSDL, const FString&, CSString);//测试代理使用
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FShowLoadUI);//显示加载UI
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FRemoveLoadUI);//显示加载UI
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FRegisterAccountSuccess);//注册成功代理
UCLASS()
class SGAME_API USGameGameInstance : public UGameInstance
{
	GENERATED_BODY()

public:
	UPROPERTY(BlueprintAssignable)
		FCSDL fcsdl;//测试代理
	UPROPERTY(BlueprintAssignable)
		FShowLoadUI m_ShowLoadUI;//显示加载UI界面
	UPROPERTY(BlueprintAssignable)
		FRemoveLoadUI m_RemoveLoadUI;//移除加载UI界面
	UPROPERTY(BlueprintAssignable)
		FChat m_Chat;//聊天
	UPROPERTY(BlueprintAssignable)
		FRegisterAccountSuccess m_RegisterAccountSuccess;//注册成功



public:
	
	UPROPERTY(EditAnywhere,BlueprintReadOnly,Category="LoadingUMG")
		TSubclassOf<UUserWidget> LoadingUMG;
	UPROPERTY()
		UUserWidget* CurrentWidget;

	virtual void Init() override;
	virtual void Shutdown() override;

	UFUNCTION()
		virtual void BeginLoadingScreen(const FString& MapName);
	UFUNCTION()
		virtual void EndLoadingScreen(UWorld* LoadedWorld);
};
